{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>用户编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">用户电话：</label>
                            <div class="layui-input-block">
                                <input type="text" disabled name="user_phone" value="{$info.user_phone}" class="layui-input" />
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">用户名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_username" value="{$info.user_username}" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">头像：</label>
                            <input type="hidden" name="user_image" id="lay-img3" value="{$info.user_image}">
                            <div class="layui-input-block">
                                <div id="lay-upload3">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list3">
                                        <img class="layui-append-img" src="{$info.user_image}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_sex" value="1" title="男" {$info.user_sex==1 ? 'checked' : ''}>
                                <input type="radio" name="user_sex" value="2" title="女" {$info.user_sex==2 ? 'checked' : ''}>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">学历：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_edu" value="{$info.user_edu}" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">生日：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_birthday" onclick="wk.lay_date2(this);" value="{$info.user_birthday}" class="layui-input" lay-verify="required" readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md12">
                            <label class="layui-form-label">省市：</label>
                            <div class="layui-input-inline">
                                <select name="user_sheng2" lay-search="" id="province"  lay-filter="province"  lay-verify="required">
                                    <option value="">---- 请选择省 ----</option>
                                    {foreach name="province" item="v1"}
                                    <option value="{$v1.district_id}" {if $info.user_sheng2 == $v1.district_id}selected{/if}>{$v1.district}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="user_shi2" lay-search=""  id="city"  lay-filter="city"  lay-verify="required">
                                    <option value="">---- 请选择市 ----</option>
                                    {foreach name="city" item="v2"}
                                    <option value="{$v2.district_id}" {if $info.user_shi2 == $v2.district_id}selected{/if}>{$v2.district}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">医院：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_hospital2" value="{$info.user_hospital2}" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">科室：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_room2" value="{$info.user_room2}" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">职位：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_job_desc2" value="{$info.user_job_desc2}" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">胸牌：</label>
                            <input type="hidden" name="user_card" id="lay-img2" value="{$info.user_card}">
                            <div class="layui-input-block">
                                <div id="lay-upload2">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list2">
                                        <img class="layui-append-img" src="{$info.user_card}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>

                        <input type="hidden" value="{$info.user_id}" name="user_id">
                        <input type="hidden" value="{$type}" name="type">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存并同意
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
</body>
</html>
<script>
    wk.uploadImg({size:5,num:3,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}"}); // 缩略图
    wk.uploadImg({size:5,num:2,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}"}); // 胸牌
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('useredit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>